$(function() {
    var path = window.location+""
    var state = getState(path);

    $.post("http://localhost:8081/study/lightbox/findAll", {
        state: state
    }, function(data) {
        console.log(data);
        if(data.success) {
            var list = data.list;
            var innerHtml = "";
            $.each(list, function(index, data) {
                innerHtml += "<a href='" + data.picUrl + "' data-lightbox='haha'><img style='height:140px; margin:3% 3%;' src='" + data.picUrl + "' /></a>"
            });
            console.log(innerHtml)
            $("#boxContent").html(innerHtml)
        }

    })
})

function getState(a) {
	var ss =a.indexOf("id");
    var cc = parseInt(ss) + 3;
    var zz = a.length;
    var state = a.substring(cc, zz)
    console.log(state)
    return state;
}